home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1994
/
MacHack 1994.toast
/
MacHack™94
/
Talks & Papers
/
Timothy Knox
/
Pocket6.3
/
Extensions
/
Starting
/
Chapter 12
/
NoWeighting
< prev
Wrap
Text File
|
1994-06-24
|
1KB
|
30 lines
\ No Weighting demo from Starting Forth Chapter 12
\ NOTE: If it says: ' STRING ? ' below,
\ load the file 'Brodie' first.
variable DENSITY variable THETA variable I.D.
: ," ( -- ) here 34 string ;
: .SUBSTANCE i.d. @ count type space ;
: MATERIAL ( 'string density theta -- ) create , , ,
does> dup @ theta ! 2+ dup @ density ! 2+ @ i.d. ! ;
: FOOT ( feet -- scaled-height ) 10 * ;
: INCH ( scaled-height -- scaled-height' )
100 12 */ 5 + 10 / + ;
: /TAN ( n -- n' ) 1000 theta @ */ ;
: PILE ( scaled-height -- )
dup dup 10 */ 1000 */ 355 339 */ /tan /tan
density @ 200 */ ." = " . ." tons of " .substance ;
\ table of materials
\ string-address density theta
," cement" 131 700 material CEMENT
," loose gravel" 93 649 material LOOSE-GRAVEL
," packed gravel" 100 700 material PACKED-GRAVEL
," dry sand" 90 754 material DRY-SAND
," wet sand" 118 900 material WET-SAND
," clay" 120 727 material CLAY
CEMENT